package com.handpay.zztong.hp.ui;

import android.content.Context;
import android.util.AttributeSet;
import android.view.animation.AlphaAnimation;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;

/****
 * 进度条控件添加
 * 
 * @author ghli 李国红
 * 
 */
public class SwiperCardProgress extends RelativeLayout{
	ProgressBar mProgress = null;
	AlphaAnimation alpha = null;

	public SwiperCardProgress(Context context, AttributeSet attrs)
	{
		super(context, attrs);
	}
//	public void showNumber(int cardNumber)
//	{
//		Log.e("cardNumber=iCardNumber", "========="+ cardNumber);
//		mProgress = (ProgressBar) this.findViewById(R.id.progress);
//        //更新代码，不需要做线程来做这种动态变化的优化
//        mProgress.setProgress(cardNumber * 10);
//        showNumberStr(cardNumber);
//	}
	
	
//	private void showNumberStr(int cardNumber){
//		final TextView tfNumber = (TextView) this.findViewById(R.id.tfNumber);
//		int width = getWidth();
//		int space = width / 10;
//        RelativeLayout.LayoutParams params = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT,
//                ViewGroup.LayoutParams.WRAP_CONTENT);
//        params.addRule(CENTER_VERTICAL);
//        if (0 == cardNumber) {
//            params.leftMargin = 0;
//        } else {
//            //params.leftMargin = cardNumber* space - space + getResources().getDimensionPixelSize(R.dimen.five_dp);
//            params.rightMargin = (10 - cardNumber) * space;
//            params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
//        }
//        tfNumber.setLayoutParams(params);
//		tfNumber.setText(String.format("%d/10", cardNumber));
//		if(alpha == null) {
//			alpha = new AlphaAnimation(0.1f, 1.0f);
//			alpha.setDuration(200);
//			tfNumber.setVisibility(View.VISIBLE);
//			tfNumber.startAnimation(alpha);
//		}
//	}

}





















